<?php

class Map extends CI_Controller {
	
	function __construct(){
		parent::__construct();
		$this->load->model('project_m');
		
	}
	
	function index(){
		
		$res = $this->project_m->display_all();
		$data = array(
			'rows' => $res
		); 
		
		$this->load->view('frontend/includes/header',$data);
		$this->load->view('frontend/map',$data);
		$this->load->view('frontend/includes/footer',$data);
	}
	function save_project(){
	
		$res = $this->project_m->save_project();
		if($res) redirect('map'); else show_error("error saving");
	}
	function search(){
		
		$res = $this->project_m->search();
		
		$data = array(
			'rows' => $res
		);
		
		$this->load->view('frontend/includes/header',$data);
		$this->load->view('frontend/map',$data);
		$this->load->view('frontend/includes/footer',$data);
	}
	
}// end map class